using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MimeCloud.AssetManagement.Business.Interface;
using MimeCloud.AssetManagement.Editor.AssetCreation;

namespace MimeCloud.AssetManagement.Editor.AssetCreation
{
    public static class Extension
    {
        public static bool IsEqual(this IAsset asset, IAsset toMatch)
        {
            
            if (toMatch.ID==Int32.MinValue  && asset.ID==Int32.MinValue)
            {
                if ((toMatch).InstanceID == (asset).InstanceID)
                {
                    return true;
                }
            }
            else if (toMatch.ID>Int32.MinValue  && asset.ID>Int32.MinValue)
            {
                if (toMatch.ID == asset.ID)
                {
                    return true;
                }
            }
            return false;
        }

        public static bool IsLocalAsset(this IAsset asset)
        {
            return (asset.ID == Int32.MinValue);

        }
    }
}